public class Problem7 {
	public static void main(String[] args) {
		long p = 2;
		for (int i = 2; i <= 10001; ++i)	{
			p = next_prime(p);
		}

		System.out.println("" + p);
	}

	private static long next_prime(long p) {
		long i = p + 1;
		
		while (true) {
			long j = 2;
			for (; j <= Math.sqrt(i); ++j) {
				if (i % j == 0)
					break;
			}

			if (i % j == 0) {
				i++;
				continue;
			}

			return i;
		}
	}
}
